#pragma once

#ifndef LHJ_CORE_PROTOCOLS_PROTOCOL_H__
#define LHJ_CORE_PROTOCOLS_PROTOCOL_H__

namespace cores
{
    namespace protocols
    {
        class Protocol
        {
        protected:
            Protocol();
            
        public:
            virtual ~Protocol();

            static Protocol* Instance();

            template <typename SubProtocol>
            SubProtocol* toSubProtocol()
            {
                return dynamic_cast<SubProtocol*>(this);
            }

        private:
            static Protocol * globalInstance;
        };
    }
}

#endif